package ar.edu.itba.it.poo

class SpecialAccount(number: String, owner: String) extends Account(number, owner) {

    private var p = 0
    def points = p

    override def credit(ammount: Int) {
        super.credit(ammount)

        p += ammount / 10
    }

    override def cashCheck(check: Check) {
        super.cashCheck(check)
        p += 5
    }
}

object SpecialAccountTest extends Application {
    val account1 = new SpecialAccount("123/4", "Bob")
    val account2 = new SpecialAccount("567/8", "Alice")

    println(account1.points)
    println(account2.points)

    account1.credit(200)
    account2.credit(400)

    val check = account2.drawCheck(100)
    account1.cashCheck(check)

    println(account1.points)
    println(account2.points)
}